<template>
    <div class="archive-other-info__item">
        <span class="icon__item el-icon-files">资源: {{ resourceCount }}</span>
        <span class="icon__item el-icon-chat-line-square">评论: {{ commentCount }}</span>
        <span class="icon__item el-icon-headset">浏览: {{ playCount }}</span>
        <span class="icon__item el-icon-star-off">点赞: {{ starCount }}</span>
        <span class="icon__item el-icon-folder-opened">分类: {{ classifyName }}</span>
    </div>
</template>

<script>
export default {
    props: {
        archive: {
            type: Object,
            required: true,
        },
    },
    computed: {
        resourceCount() {
            return this.archive.resources.split(",").length;
        },
        commentCount() {
            return this.archive.rpcount || 0;
        },
        playCount() {
            return this.archive.hit || 0;
        },
        starCount() {
            return this.archive.liked || 0;
        },
        classifyName() {
            return this.archive.className || "";
        },
    },
};
</script>

<style lang="scss">
.archive-other-info__item {
    font-size: 12px;
    color: $textGrey;

    .icon__item {
        margin-right: 20px;
    }

    .icon__item::before {
        margin-right: 5px;
    }
}
</style>
